using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace PUCIT.eFCS.DataAccess.Models.Mapping
{
    public class documentMap : EntityTypeConfiguration<document>
    {
        public documentMap()
        {
            // Primary Key
            this.HasKey(t => t.documentId);

            // Properties
            this.Property(t => t.name)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.version)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("document");
            this.Property(t => t.documentId).HasColumnName("documentId");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.version).HasColumnName("version");
            this.Property(t => t.isDocComplete).HasColumnName("isDocComplete");
            this.Property(t => t.totalSections).HasColumnName("totalSections");
            this.Property(t => t.completedSections).HasColumnName("completedSections");
        }
    }
}
